package com.xyz.domain.ext;

public enum EnumPeriodStatus {

    UNSTART("未开始",1),
    END("已结束",9);

    private String name;

    private Integer key;

    EnumPeriodStatus(String name, Integer key){
        this.name = name;
        this.key = key;
    }

    public EnumPeriodStatus getByKey(Integer key){
        if(key == null){
            return null;
        }
        for(EnumPeriodStatus source : EnumPeriodStatus.values()){
            if(source.getKey() == key){
                return source;
            }
        }
        return  null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }
}
